// 这个文件时Anugular 根组件，告诉Angular如何组装组件

// Angular核心模块
import { NgModule } from '@angular/core';

// BrowserModule  浏览器解析的模块
import { BrowserModule } from '@angular/platform-browser';

//引入路由配置文件
import { AppRoutingModule } from './app-routing.module';

// 引入管道
import { MydemoPipe } from './pipe/mydemo.pipe';

// FormsModule实现双向绑定
import { FormsModule } from '@angular/forms';

// 引入服务
import { MyserviceService } from './services/myservice.service';
import { AxiosService } from './services/axios.service';


// 引入HttpClientMidule模块，实现数据交互
// 若需要使用jsonp，则需引入HttpClientJsonpModule模块
import { HttpClientModule,HttpClientJsonpModule } from '@angular/common/http'

// 引入根组件
import { AppComponent } from './app.component';
// 引入其余组件
import { NewsComponent } from './components/news/news.component';
import { HeaderComponent } from './components/header/header.component';
import { FormComponent } from './components/form/form.component';
import { SearchComponent } from './components/search/search.component';
import { TodolistComponent } from './components/todolist/todolist.component';
import { ViewchildComponent } from './components/viewchild/viewchild.component';
import { ComponentComponent } from './components/component/component.component';
import { LifefnComponent } from './components/lifefn/lifefn.component';
import { RxjsComponent } from './components/rxjs/rxjs.component'
import { NetworkComponent } from './components/network/network.component';
import { AxiosComponent } from './components/axios/axios.component';
import { RouterComponent } from './components/router/router.component';
import { RoutergetComponent } from './components/routerget/routerget.component';
import { RoutermainComponent } from './components/routermain/routermain.component';
import { RouterchildComponent } from './components/routerchild/routerchild.component';


// @NgModule修饰器，@NgModule接受一个元数据对象，告诉Angular如何编译和启动应用
@NgModule({
  declarations: [   //配置当前项目运行的组件
    AppComponent, NewsComponent, HeaderComponent, MydemoPipe, FormComponent, SearchComponent, TodolistComponent, ViewchildComponent, ComponentComponent, LifefnComponent, RxjsComponent, NetworkComponent, AxiosComponent, RouterComponent, RoutergetComponent, RoutermainComponent, RouterchildComponent
  ],
  imports: [        //配置当前模块运行依赖的其他模块
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    HttpClientJsonpModule
  ],
  providers: [  MyserviceService,AxiosService ],    //配置项目所需要的服务
  bootstrap: [AppComponent]   /*指定应用的主视图即默认加载的页面(称为根组件)，
                                通过引导根AppComponent来启动应用
                                这里一般写的是根组件
                               */
})
// 跟模块不需要导出任何东西，因为其他组件不需要引入跟模块
export class AppModule { }
